/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: LoginUtil
 * Author:   kadibeieun
 * Date:     2019/8/13 11:34
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package messageCommunication.util;

import io.netty.channel.Channel;
import io.netty.util.Attribute;
import messageCommunication.attribute.Attributes;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author kadibeieun
 * @create 2019/8/13
 * @since 1.0.0
 */
public class LoginUtil {

    public static void markAsLogin(Channel channel) {
        channel.attr(Attributes.LOGIN).set(true);
    }

    public static boolean hasLogin(Channel channel) {
        Attribute<Boolean> loginAttr = channel.attr(Attributes.LOGIN);
        return loginAttr.get() != null;

    }

}